-- @owner: xuwenfei1
-- @date: 2025/5/21
-- @testpoint: 验证事务开启BEGIN TRAN语法，部分合理报错

@conn PrimaryDbDmode;
--step0：前置条件：D库有shark插件; expect: 成功
drop table if exists ValueTable;

--step1：BEGIN TRAN语法; expect: 成功,查询到数据1-5
create table ValueTable(id int);
Begin tran;/
insert into ValueTable values(1);
commit;
Begin transaction ;/
insert into ValueTable values(2);
commit;
Begin tran  transaction_name1;/
insert into ValueTable values(3);
commit;
Begin transaction  transaction_name2;/
insert into ValueTable values(4);
commit;
Begin;/
insert into ValueTable values(5);
commit;
select * from ValueTable;

--step2：开启多个事务; expect: 合理告警
Begin tran;/
Begin transaction ;/
commit;

--step3:清理环境; expect：成功
drop table if exists ValueTable;